#include "linkproperty.h"
#include <QtGui>
#include "link.h"

void linkproperty::setLink1(link *couple1)
{
    this->mycouple1=couple1;
}

link* linkproperty::couple1()
{
    return this->mycouple1;
}

/*blockproperty::blockproperty(const node* &block1)
{
    this->setBlock1(block1);
}*/


 void linkproperty::id_accept()
{
    this->mycouple1->getLink()->setObj_id(this->lineEdit->text());
}


/*blockproperty::blockproperty(QWidget *parent) : QDialog(parent)
{
    setupUi(this);

    connect(pushButton, SIGNAL(clicked()), this, SLOT(id_accept()));
    connect(pushButton_2, SIGNAL(clicked()), this, SLOT(reject()));
}*/

linkproperty::linkproperty(link* couple1, QWidget *parent) : QDialog(parent)
{
    this->setLink1(couple1);
    setupUi(this);

    connect(pushButton, SIGNAL(clicked()), this, SLOT(id_accept()));
    connect(pushButton, SIGNAL(clicked()), this, SLOT(accept()));
    connect(pushButton_2, SIGNAL(clicked()), this, SLOT(reject()));
}


void linkproperty::on_lineEdit_textChanged()
{
    pushButton->setEnabled(lineEdit->hasAcceptableInput());
    pushButton->setEnabled(lineEdit_2->hasAcceptableInput());
    pushButton->setEnabled(lineEdit_3->hasAcceptableInput());
}
